package com.ydx.meituan.protocol;

import com.fasterxml.jackson.annotation.JsonInclude;

/**
 *
 * Description:返回数据结构
 *
 */
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public class NetResult<DataType> {
    public static final int SUCCESS = 0;//请求成功
    public static final int ERROR = 3;//错误
    public static final String MSG_SUCCESS = "SUCCESS";//msg信息：成功
    public static final String MSG_ERROR = "UNKOWN";//msg信息：有错误
    /**
     * 错误码
     */
    private int result = SUCCESS;
    private String message = MSG_SUCCESS;//消息
    private DataType data;//数据体

    public NetResult() {
    }

    public NetResult(int result, String message) {
        this.result = result;
        this.message = message;
    }

    public NetResult(int result, String message, DataType data) {
        this.result = result;
        this.message = message;
        this.data = data;
    }

    public int getResult() {
        return result;
    }

    public void setResult(int result) {
        this.result = result;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public DataType getData() {
        return data;
    }

    public void setData(DataType data) {
        this.data = data;
    }
}
